<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <title>nchnls_i</title>
    <link rel="stylesheet" type="text/css" href="csound.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="home" href="index.html" title="The Canonical Csound Reference Manual" />
    <link rel="up" href="OpcodesTop.html" title="Orchestra Opcodes and Operators" />
    <link rel="prev" href="nchnls.html" title="nchnls" />
    <link rel="next" href="nestedap.html" title="nestedap" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">nchnls_i</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="nchnls.html">Prev</a> </td>
          <th width="60%" align="center">Orchestra Opcodes and Operators</th>
          <td width="20%" align="right"> <a accesskey="n" href="nestedap.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="refentry">
      <a id="nchnls_i"></a>
      <div class="titlepage"></div>
      <a id="IndexNchns_I" class="indexterm"></a>
      <div class="refnamediv">
        <h2>
          <span class="refentrytitle">nchnls_i</span>
        </h2>
        <p>nchnls_i — 
      Sets the number of channels of audio input.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp127046576"></a>
        <h2>Description</h2>
        <p> 
      These statements are global value <a class="link" href="assign.html" title="="><em class="citetitle">assignments</em></a>, made
      at the beginning of an orchestra, before any instrument block is
      defined. Their function is to set certain <a class="link" href="OrchKvar.html#VariableTypes" title="Table 3. Types of Variables"><em class="citetitle">reserved symbol
      variables</em></a> that are required for
      performance. Once set, these reserved symbols can be used in
      expressions anywhere in the orchestra.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp127116432"></a>
        <h2>Syntax</h2>
        <pre class="synopsis"><span class="command"><strong>nchnls_i</strong></span> = iarg</pre>
      </div>
      <div class="refsect1">
        <a id="idp127118448"></a>
        <h2>Initialization</h2>
        <p>
<span class="emphasis"><em>nchnls_i</em></span> = (optional) -- set number of channels of
audio input to <span class="emphasis"><em>iarg</em></span>. (1 = mono, 2 = stereo, 4 =
quadraphonic.) The default value is the valus of <span class="emphasis"><em>nchnls</em></span>.
    </p>
        <p>
      In addition, any <a class="link" href="OrchKvar.html#GlobalVariables"><em class="citetitle">global variable</em></a> can be initialized by an <span class="emphasis"><em>init-time assignment</em></span> anywhere before the first <a class="link" href="instr.html" title="instr"><em class="citetitle">instr statement</em></a>.  All of the above assignments are run as instrument 0 (i-pass only) at the start of real performance.
    </p>
      </div>
      <div class="refsect1">
        <a id="idp127123936"></a>
        <h2>Examples</h2>
        <p>
      Here is an example of the nchnls_i opcode. It uses the file <a class="ulink" href="examples/nchnls_i.csd" target="_top"><em class="citetitle">nchnls_i.csd</em></a>.
      </p>
        <div class="example">
          <a id="idp127125792"></a>
          <p class="title">
            <strong>Example 536. Example of the nchnls_i opcode.</strong>
          </p>
          <div class="example-contents">
            <p>See the sections <a class="link" href="UsingRealTime.html" title="Real-Time Audio"><em class="citetitle">Real-time Audio</em></a> and <a class="link" href="CommandFlags.html" title="Csound command line"><em class="citetitle">Command Line Flags</em></a> for more information on using command line flags.</p>
            <pre class="programlisting">
<span class="csdtag">&lt;CsoundSynthesizer&gt;</span>
<span class="csdtag">&lt;CsOptions&gt;</span>
<span class="comment">; Select audio/midi flags here according to platform</span>
-odac  -idac <span class="comment">;;;realtime audio I/O</span>
<span class="comment">; For Non-realtime ouput leave only the line below:</span>
<span class="comment">; nchnls_i.wav -W ;;; for file output any platform</span>
<span class="csdtag">&lt;/CsOptions&gt;</span>
<span class="csdtag">&lt;CsInstruments&gt;</span>

<span class="ohdr">sr</span>   <span class="op">=</span> 44100
<span class="ohdr">ksmps</span>   <span class="op">=</span> 32
<span class="ohdr">nchnls</span>   <span class="op">=</span> 2	<span class="comment">;2 channels out</span>
<span class="ohdr">0dbfs</span>    <span class="op">=</span> 1
nchnls_i <span class="op">=</span> 4	<span class="comment">;4 channels in</span>

<span class="oblock">instr</span> 1 <span class="comment">;4 channels in, two channels out</span>

ain1, ain2, ain3, ain4 <span class="opc">inq</span>		<span class="comment">;grab your mics and sing</span>

adel   <span class="opc">linseg</span> 0, p3<span class="op">*</span>.5, 0.02, p3<span class="op">*</span>.5, 0	  <span class="comment">;max delay time = 20ms</span>
adel2  <span class="opc">linseg</span> 0.02, p3<span class="op">*</span>.5, 0, p3<span class="op">*</span>.5, 0.02 <span class="comment">;max delay time = 20ms	</span>
aoutl  <span class="opc">flanger</span> ain1, adel, .7
aoutr  <span class="opc">flanger</span> ain2, adel<span class="op">*</span>2, .8
aoutla <span class="opc">flanger</span> ain3, adel2, .9
aoutra <span class="opc">flanger</span> ain4, adel2<span class="op">*</span>2, .5
<span class="comment">;write to quad file, 16 bits with header</span>
       <span class="opc">fout</span> "in_4.wav", 14, aoutl, aoutr, aoutla, aoutra	
       <span class="opc">outs</span> (aoutl<span class="op">+</span>aoutla)<span class="op">*</span>.5, (aoutr<span class="op">+</span>aoutra)<span class="op">*</span>.5 <span class="comment">;stereo out</span>

<span class="oblock">endin</span>
<span class="csdtag">&lt;/CsInstruments&gt;</span>
<span class="csdtag">&lt;CsScore&gt;</span>

<span class="stamnt">i</span> 1 0 10
<span class="stamnt">e</span>
<span class="csdtag">&lt;/CsScore&gt;</span>
<span class="csdtag">&lt;/CsoundSynthesizer&gt;</span>
</pre>
          </div>
        </div>
        <p><br class="example-break" />
    </p>
      </div>
      <div class="refsect1">
        <a id="idp127130080"></a>
        <h2>See Also</h2>
        <p>
      <a class="link" href="kr.html" title="kr"><em class="citetitle">kr</em></a>,
      <a class="link" href="ksmps.html" title="ksmps"><em class="citetitle">ksmps</em></a>,
      <a class="link" href="nchnls.html" title="nchnls"><em class="citetitle">nchnls</em></a>,
      <a class="link" href="sr.html" title="sr"><em class="citetitle">sr</em></a>
    </p>
      </div>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="nchnls.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="OpcodesTop.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="nestedap.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top">nchnls </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> nestedap</td>
        </tr>
      </table>
    </div>
  </body>
</html>
